package com.terrynoya.fight.stateMachine.controllers
{
	import com.terrynoya.fight.char.Character;
	import com.terrynoya.fight.stateMachine.StateController;
	
	public class SelfState extends StateController
	{
		public function SelfState(name:String)
		{
			super(name);
		}
		
		override public function run(character:Character):void
		{
			var stateExist:Boolean = this.hasAttribute("value");
			if(!stateExist)
			{
				return;
			}
			var stateId:int = this.getAttributeAsInt("value");
			character.stateManager.foreignMachine = null;
			character.stateManager.changeState(stateId);
		}
	}
}